<cfcomponent extends="assets.csac.com.Base">

	<cfscript>
        import assets.csac.com.service.ProductCategoryService;
		this.service = new ProductCategoryService();
	</cfscript>

	<cffunction name="get" output="false" access="remote" returntype="assets.csac.com.bo.ProductCategory">
		<cfreturn this.service.get(argumentCollection = arguments) />
	</cffunction>
	
	<cffunction name="query" output="false" access="public" returntype="query">
		<cfreturn this.service.read(argumentCollection = arguments) />
	</cffunction>
	
	<cffunction name="save" output="false" access="public" returntype="any">
        <cfscript>
			var productCategory = "";
			var productCategory_ = this.service.get(Product_Category_ID = arguments.Product_Category_ID);
			if (IsInstanceOf(arguments[1], "assets.csac.com.bo.ProductCategory")) {
				productCategory = arguments[1];
			} else {
				var args = {};
				StructAppend(args, arguments);
				args.obj = Duplicate(productCategory_);
				productCategory = this.service.load(argumentCollection = args);
			}
			productCategory.setProduct_Category_ID(this.service.save(productCategory));
			return productCategory;
        </cfscript>
	</cffunction>
	
	<cffunction name="delete" output="false" access="public" returntype="boolean">
		<cfreturn this.service.destroy(argumentCollection = arguments) />
	</cffunction>
	
</cfcomponent>